package com.syx.friend.Controller.user;

import com.syx.commoncore.Constant.HttpConstants;
import com.syx.commoncore.Model.Result;
import com.syx.commoncore.Model.TableDataInfoResult;
import com.syx.friend.Aop.CheckUserStatus;
import com.syx.friend.Model.exam.DTO.ExamDTO;
import com.syx.friend.Model.exam.DTO.ExamQueryDTO;
import com.syx.friend.Service.IUserExamService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/user/exam")
@RestController
public class UserExamController {
    @Resource
    IUserExamService iUserExamService;

    //竞赛报名
    @CheckUserStatus
    @PostMapping("/enter")
    public Result<Void> enter(@RequestBody ExamDTO examDTO, @RequestHeader(HttpConstants.AUTHENTICATION) String token){

        return iUserExamService.enter(examDTO,token);


    }

    //我的竞赛列表
    @GetMapping("/list")
    public TableDataInfoResult list(ExamQueryDTO examQueryDTO){
        return iUserExamService.list(examQueryDTO);


    }






}
